﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Db2Model
{
    static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
        }

        class basea
        {
            public  string GetProperyName()
            {
                var methodName = new StackTrace(true).GetFrame(2).GetMethod().Name;
                if (methodName.StartsWith("get_") || methodName.StartsWith("set_") ||
                    methodName.StartsWith("put_"))
                {
                    return methodName.Substring("get_".Length);
                }
                throw new Exception(methodName + " not a method of Property");
            }
        }

        class cls : basea
        {
            void setP(ref string desc, string val)
            {
                var a = GetProperyName();
                desc = val;
            }
            private string _abc;
            public string Abc
            {
                get { return _abc; }
                set
                {
                    //_abc = value;
                    setP(ref _abc, value);
                }
            }
        }
    }
}
